<?php
/* @var $this ProductController */
/* @var $model Product */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'product-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of CActiveForm for details on this.
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'product_title'); ?>
		<?php echo $form->textField($model,'product_title',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'product_title'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'price_g'); ?>
		<?php echo $form->textField($model,'price_g'); ?>
		<?php echo $form->error($model,'price_g'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'description'); ?>
		<?php $this->widget('application.extensions.ckeditor.CKEditor',array(
		'model'=>$model,
		'attribute'=>'description',
		'language'=>'ru',
		'editorTemplate'=>'full',))
		;?>
		<?php echo $form->error($model,'description'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'insight'); ?>
		<?php echo $form->dropDownList($model,'insight',  array(1=>'да',0=>'нет')); ?>
		<?php echo $form->error($model,'insight'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'category_id'); ?>
		<?php echo $form->dropDownList($model,'category_id',  Category::all()); ?>
		<?php echo $form->error($model,'category_id'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'subcategory_id'); ?>
		<?php echo $form->dropDownList($model,'subcategory_id',  Subcategory::all()); ?>
		<?php echo $form->error($model,'subcategory_id'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton('Создать'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->